package src;
import java.awt.Graphics;
import java.awt.Graphics2D;

import javax.swing.JComponent;
import java.awt.Rectangle;
import java.awt.geom.Line2D;


@SuppressWarnings("serial")
public class DrawRails extends JComponent {
	
	/**
	 * Rails of train
	 */
	@Override
	public void paintComponent(Graphics g){
		//Create an Graphic object 2D
		Graphics2D g2 = (Graphics2D) g;
		
		//Normal Rails
		Rectangle rails = new Rectangle(100, 100, 1000, 500);
		g2.draw(rails);
		
		//Rails shared
		Line2D line = new Line2D.Double(600, 100, 600, 600);
		g2.draw(line);
	}
}
